
<ul class="breadcrumb">
    <li><?php
        echo $control->getAjaxLink('功能角色列表', array(
            'cooker' => 'BAEvent@showEventRoleList'
        ));
        ?> </li>
</ul>
<div class="">
    <div class="roleList">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>角色别名</th>
                    <th>所属应用</th>
                    <th>功能名称</th>
                    <th>功能首页</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $eventCooker = new BAEventCooker();
                $eventHome = '--';
                foreach ($eventRoleList as $id => $list) {
                    $listData = $list->getItemsInArray();
                    $eventId = $listData['eventId'];
                    $event = $eventCooker->getEvent($eventId);
                    $eventData = $event->getItemsInArray();
                    $roleId = $listData['roleId'];
                    $role = new BRole($roleId);
                    $appId = $role->appId;
                    $appClass = BApp::getAppClassById($appId);
                    $fullName = $role->getFullName();
                    $roleAlias = BARoleCooker::getRoleAliasByFullName($fullName);
                    if (isset($listData['eventHome'])) {
                        $eventHome = $listData['eventHome'];
                    }
                    ?>
                    <tr>
                        <td><?php echo $roleAlias; ?></td>
                        <td><?php echo yii::t('site', $appClass); ?></td>
                        <td><?php echo $eventData['alias']; ?></td>
                        <td><?php echo $eventHome; ?></td>
                        <td>
                            <?php
                            echo $control->getAjaxLink('修改', array(
                                'cooker' => 'BAEventCooker@showModifyEventRole',
                                'eventRoleId' => $id,
                                'htmlOptions' => array(
                                    'class' => ''
                            )));
                            ?> |
                            <?php
                            echo $control->getAjaxLink('删除', array(
                                'cooker' => 'BAEventCooker@deleteEventRole',
                                'eventRoleId' => $id,
                                'htmlOptions' => array(
                                    'class' => ''
                            )));
                            ?> </td>
                    </tr>
                <?php } ?>
            </tbody>
        </table>
    </div>
    <div>
        <?php
        echo $control->getAjaxLink('添加功能角色', array(
            'cooker' => 'BAEventCooker@showAddEventRole',
            'htmlOptions' => array(
                'class' => 'btn'
        )));
        ?>
    </div>
</div>